package com.zm.service;

import com.zm.bean.TestDoorResultBean;
import com.zm.repositories.jpa.CabTestDoorResultRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;


@Service
public class CabTestDoorResultServiceImpl implements CabTestDoorResultService {

    @Resource
    private CabTestDoorResultRepository mRepository;


    @Override
    public Optional<TestDoorResultBean> findById(Long aLong) {
        return mRepository.findById(aLong);
    }

    @Override
    public List<TestDoorResultBean> findAll() {
        return mRepository.findAll();
    }


    @Override
    public boolean existsById(long id) {
        return mRepository.existsById(id);
    }

    @Override
    public void deleteById(long id) {
        mRepository.deleteById(id);
    }

    @Override
    public TestDoorResultBean save(TestDoorResultBean mBean) {
        return mRepository.save(mBean);
    }

    @Override
    public List<TestDoorResultBean> saveAll(List<TestDoorResultBean> mList) {
        return mRepository.saveAll(mList);
    }

    @Override
    public List<TestDoorResultBean> findAllByTestStartTimeAfter(long d1) {
        return mRepository.findAllByTestStartTimeAfter(d1);
    }

    @Override
    public List<TestDoorResultBean> findTestDoorResultBeansByCabinetIdAndTestStartTimeAfter(String cid, long d1) {
        return mRepository.findTestDoorResultBeansByCabinetIdAndTestStartTimeAfter(cid, d1);
    }
}
